<?php
/**
 * 使用说明:在计划任务中添加下面的计划.
 * 		1.windows下配置计划任务
 * 			php程序路径	-q	该文件本地绝对路径
 * 			"D:\Kim\PHPPROGRAM\php.exe" -q "C:\Documents and Settings\kim007\Zend\workspaces\DefaultWorkspace7\newquick\Admin\autorun.php"
 * 			"D:\Program Files\PHPnow-1.5.4\php-5.2.10-Win32\php.exe" -q "E:\autorun.php"
 * 
 * 注意事项:
 * 	1.配置正确的网站域名
 * 	2.设置正确的执行定时任务密码
 * 
 * www.t.com/Admin/index.php/Task/send/pw/74be16979710d4c4e7c6647856088456
 */

$_tmp_site 	= 	"www.t.com";//网站域名
$_tmp_pwd	=	"74be16979710d4c4e7c6647856088456";//执行定时任务密码
$_tmp_url	=	"/Admin/index.php/Task/send/pw/";//url路径，执行定时任务的路径

_tmp_http_post($_tmp_site,$_tmp_url.$_tmp_pwd,'');

/**
 * 临时函数用于，php访问URL路径。
 */
function _tmp_http_post($host,$path,$data){
    $fp = fsockopen($host, 80);
    fputs($fp,"GET $path HTTP/1.1\r\n");
    fputs($fp,"Host: $host\r\n");
    fputs($fp,"Content-type: application/x-www-form-urlencoded\r\n");
    fputs($fp,"Content-length: " . strlen($data) . "\r\n");
    //fputs($fp, "User-Agent: MSIE\r\n");
    //fputs($fp, "Connection: close\r\n\");
    fputs($fp, "\r\n");
    fputs($fp, $data);
    
    $buf='';
    while (!feof($fp)) {
        $buf .= fgets($fp,128);
    }
    fclose($fp);
    return $buf;
}

?>